home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / EPPC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  4.4 KB  |  171 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        EPPC.h
  3.  
  4.      Contains:    High Level Event Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1988-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __EPPC__
  19. #define __EPPC__
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. #ifndef __APPLETALK__
  25. #include <AppleTalk.h>
  26. #endif
  27. #ifndef __FILES__
  28. #include <Files.h>
  29. #endif
  30. #ifndef __PPCTOOLBOX__
  31. #include <PPCToolbox.h>
  32. #endif
  33. #ifndef __PROCESSES__
  34. #include <Processes.h>
  35. #endif
  36. #ifndef __EVENTS__
  37. #include <Events.h>
  38. #endif
  39.  
  40.  
  41.  
  42. #if PRAGMA_ONCE
  43. #pragma once
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #if PRAGMA_IMPORT
  51. #pragma import on
  52. #endif
  53.  
  54. #if PRAGMA_STRUCT_ALIGN
  55.     #pragma options align=mac68k
  56. #elif PRAGMA_STRUCT_PACKPUSH
  57.     #pragma pack(push, 2)
  58. #elif PRAGMA_STRUCT_PACK
  59.     #pragma pack(2)
  60. #endif
  61.  
  62.  
  63. enum {
  64.                                                                 /* postOptions currently supported */
  65.     receiverIDMask                = 0x0000F000,
  66.     receiverIDisPSN                = 0x00008000,
  67.     receiverIDisSignature        = 0x00007000,
  68.     receiverIDisSessionID        = 0x00006000,
  69.     receiverIDisTargetID        = 0x00005000,
  70.     systemOptionsMask            = 0x00000F00,
  71.     nReturnReceipt                = 0x00000200,
  72.     priorityMask                = 0x000000FF,
  73.     nAttnMsg                    = 0x00000001
  74. };
  75.  
  76.  
  77. enum {
  78.                                                                 /* constant for return receipts */
  79.     HighLevelEventMsgClass        = FOUR_CHAR_CODE('jaym'),
  80.     rtrnReceiptMsgID            = FOUR_CHAR_CODE('rtrn')
  81. };
  82.  
  83.  
  84. enum {
  85.     msgWasPartiallyAccepted        = 2,
  86.     msgWasFullyAccepted            = 1,
  87.     msgWasNotAccepted            = 0
  88. };
  89.  
  90. struct TargetID {
  91.     long                             sessionID;
  92.     PPCPortRec                         name;
  93.     LocationNameRec                 location;
  94.     PPCPortRec                         recvrName;
  95. };
  96. typedef struct TargetID TargetID;
  97.  
  98. typedef TargetID *                        TargetIDPtr;
  99. typedef TargetIDPtr *                    TargetIDHandle;
  100. typedef TargetIDHandle                     TargetIDHdl;
  101. typedef TargetID                         SenderID;
  102. typedef SenderID *                        SenderIDPtr;
  103. struct HighLevelEventMsg {
  104.     unsigned short                     HighLevelEventMsgHeaderLength;
  105.     unsigned short                     version;
  106.     unsigned long                     reserved1;
  107.     EventRecord                     theMsgEvent;
  108.     unsigned long                     userRefcon;
  109.     unsigned long                     postingOptions;
  110.     unsigned long                     msgLength;
  111. };
  112. typedef struct HighLevelEventMsg HighLevelEventMsg;
  113.  
  114. typedef HighLevelEventMsg *                HighLevelEventMsgPtr;
  115. typedef HighLevelEventMsgPtr *            HighLevelEventMsgHandle;
  116. typedef HighLevelEventMsgHandle         HighLevelEventMsgHdl;
  117. typedef CALLBACK_API( Boolean , GetSpecificFilterProcPtr )(void *contextPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  118. typedef STACK_UPP_TYPE(GetSpecificFilterProcPtr)                 GetSpecificFilterUPP;
  119. enum { uppGetSpecificFilterProcInfo = 0x00000FD0 };             /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes) */
  120. #define NewGetSpecificFilterProc(userRoutine)                     (GetSpecificFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentArchitecture())
  121. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender)  CALL_THREE_PARAMETER_UPP((userRoutine), uppGetSpecificFilterProcInfo, (contextPtr), (msgBuff), (sender))
  122. EXTERN_API( OSErr )
  123. PostHighLevelEvent                (const EventRecord *    theEvent,
  124.                                  void *                    receiverID,
  125.                                  unsigned long             msgRefcon,
  126.                                  void *                    msgBuff,
  127.                                  unsigned long             msgLen,
  128.                                  unsigned long             postingOptions)                        THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  129.  
  130. EXTERN_API( OSErr )
  131. AcceptHighLevelEvent            (TargetID *                sender,
  132.                                  unsigned long *        msgRefcon,
  133.                                  void *                    msgBuff,
  134.                                  unsigned long *        msgLen)                                THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  135.  
  136. EXTERN_API( OSErr )
  137. GetProcessSerialNumberFromPortName (const PPCPortRec *    portName,
  138.                                  ProcessSerialNumber *    pPSN)                                THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  139.  
  140. EXTERN_API( OSErr )
  141. GetPortNameFromProcessSerialNumber (PPCPortRec *        portName,
  142.                                  const ProcessSerialNumber * pPSN)                            THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  143.  
  144. EXTERN_API( Boolean )
  145. GetSpecificHighLevelEvent        (GetSpecificFilterUPP     aFilter,
  146.                                  void *                    contextPtr,
  147.                                  OSErr *                err)                                THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  148.  
  149.  
  150.  
  151. #if PRAGMA_STRUCT_ALIGN
  152.     #pragma options align=reset
  153. #elif PRAGMA_STRUCT_PACKPUSH
  154.     #pragma pack(pop)
  155. #elif PRAGMA_STRUCT_PACK
  156.     #pragma pack()
  157. #endif
  158.  
  159. #ifdef PRAGMA_IMPORT_OFF
  160. #pragma import off
  161. #elif PRAGMA_IMPORT
  162. #pragma import reset
  163. #endif
  164.  
  165. #ifdef __cplusplus
  166. }
  167. #endif
  168.  
  169. #endif /* __EPPC__ */
  170.  
  171.